home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / minix / up1510b.tgz / up1510b / src / fs / protect.c.D < prev    next >
Text File  |  1990-07-25  |  4KB  |  132 lines

  1. *** /tmp/,RCSt1022244    Wed Jul 25 13:48:59 1990
  2. --- protect.c    Mon Jul 23 11:34:24 1990
  3. ***************
  4. *** 10,22 ****
  5.    */
  6.   
  7. ! #include "../h/const.h"
  8. ! #include "../h/type.h"
  9. ! #include "../h/error.h"
  10. ! #include "const.h"
  11. ! #include "type.h"
  12.   #include "buf.h"
  13.   #include "file.h"
  14.   #include "fproc.h"
  15. - #include "glo.h"
  16.   #include "inode.h"
  17.   #include "param.h"
  18. --- 10,17 ----
  19.    */
  20.   
  21. ! #include "fs.h"
  22.   #include "buf.h"
  23.   #include "file.h"
  24.   #include "fproc.h"
  25.   #include "inode.h"
  26.   #include "param.h"
  27. ***************
  28. *** 32,36 ****
  29.     register struct inode *rip;
  30.     register int r;
  31. -   extern struct inode *eat_path();
  32.   
  33.     /* Temporarily open the file. */
  34. --- 27,30 ----
  35. ***************
  36. *** 70,74 ****
  37.     register struct inode *rip;
  38.     register int r;
  39. -   extern struct inode *eat_path();
  40.   
  41.     /* Only the super_user may perform the chown() call. */
  42. --- 64,67 ----
  43. ***************
  44. *** 98,102 ****
  45.   {
  46.   /* Perform the umask(co_mode) system call. */
  47. !   register mask_bits r;
  48.   
  49.     r = ~fp->fp_umask;        /* set 'r' to complement of old mask */
  50. --- 91,95 ----
  51.   {
  52.   /* Perform the umask(co_mode) system call. */
  53. !   register mode_t r;
  54.   
  55.     r = ~fp->fp_umask;        /* set 'r' to complement of old mask */
  56. ***************
  57. *** 115,119 ****
  58.     struct inode *rip;
  59.     register int r;
  60. -   extern struct inode *eat_path();
  61.   
  62.     /* Temporarily open the file whose access is to be checked. */
  63. --- 108,111 ----
  64. ***************
  65. *** 122,126 ****
  66.   
  67.     /* Now check the permissions. */
  68. !   r = forbidden(rip, (mask_bits) mode, 1);
  69.     put_inode(rip);
  70.     return(r);
  71. --- 114,118 ----
  72.   
  73.     /* Now check the permissions. */
  74. !   r = forbidden(rip, (mode_t) mode, 1);
  75.     put_inode(rip);
  76.     return(r);
  77. ***************
  78. *** 133,137 ****
  79.   PUBLIC int forbidden(rip, access_desired, real_uid)
  80.   register struct inode *rip;    /* pointer to inode to be checked */
  81. ! mask_bits access_desired;    /* RWX bits */
  82.   int real_uid;            /* set iff real uid to be tested */
  83.   {
  84. --- 125,129 ----
  85.   PUBLIC int forbidden(rip, access_desired, real_uid)
  86.   register struct inode *rip;    /* pointer to inode to be checked */
  87. ! mode_t access_desired;    /* RWX bits */
  88.   int real_uid;            /* set iff real uid to be tested */
  89.   {
  90. ***************
  91. *** 138,146 ****
  92.   /* Given a pointer to an inode, 'rip', and the access desired, determine
  93.    * if the access is allowed, and if not why not.  The routine looks up the
  94. !  * caller's uid in the 'fproc' table.  If the access is allowed, OK is returned
  95.    * if it is forbidden, EACCES is returned.
  96.    */
  97.   
  98. !   register mask_bits bits, perm_bits, xmask;
  99.     int r, shift, test_uid, test_gid;
  100.   
  101. --- 130,138 ----
  102.   /* Given a pointer to an inode, 'rip', and the access desired, determine
  103.    * if the access is allowed, and if not why not.  The routine looks up the
  104. !  * caller's uid in the 'fproc' table.  If access is allowed, OK is returned
  105.    * if it is forbidden, EACCES is returned.
  106.    */
  107.   
  108. !   register mode_t bits, perm_bits, xmask;
  109.     int r, shift, test_uid, test_gid;
  110.   
  111. ***************
  112. *** 179,183 ****
  113.    *                read_only                     *
  114.    *===========================================================================*/
  115. ! PRIVATE int read_only(ip)
  116.   struct inode *ip;        /* ptr to inode whose file sys is to be cked */
  117.   {
  118. --- 171,175 ----
  119.    *                read_only                     *
  120.    *===========================================================================*/
  121. ! PUBLIC int read_only(ip)
  122.   struct inode *ip;        /* ptr to inode whose file sys is to be cked */
  123.   {
  124. ***************
  125. *** 187,191 ****
  126.   
  127.     register struct super_block *sp;
  128. -   extern struct super_block *get_super();
  129.   
  130.     sp = get_super(ip->i_dev);
  131. --- 179,182 ----
  132.